package cn.wit.test;

import org.junit.Test;

/**
 * 字符串格式化
 * @author 16604
 *
 */

public class DemoStringFormat {

	
	@Test
	public void test() {
	
		Student student = new Student("王小虎",18,"面向对象");
		
		student.setScore(88.5);
		
		String format = "年纪为%d得学生%s正在一脸懵逼得听着%s得课程,他考了%3.1f分";
		
		System.out.println(String.format(format, student.getAge(),student.getName(),student.getContent(),student.getScore()));
		

	}

}
